<template>
  <div>
    <el-form :inline="true" class="demo-form-inline">
      <el-form-item label="">
        <div style="display: flex;border-radius: 12px;">
          <el-input size="small" v-model="searchPar" placeholder="请输入标题或内容" class="myInput">
            <i
                class="el-icon-circle-close el-input__icon"
                slot="suffix"
                @click="handleIconClick">
            </i>
          </el-input>
          <el-button style="border-radius: 0 12px 12px 0;font-size:16px;
          background:#0F47B8;border: #0F47B8;box-shadow: none;padding: 0 20px 0 20px"
                     size="small" type="primary" @click="onSubmit"> 查 询 </el-button>
        </div>

      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "searchForm",
  data() {
    return {
      list:[],
      searchPar:'object'!==typeof this.$store.getters.search?this.$store.getters.search :''
    }
  },
  watch:{
    searchPar(){
      console.log(999)
      console.log(this.searchPar)
      this.$emit('sub')
    }
  },
  created() {

    //this.getPer()
  },
  methods: {
    handleIconClick(){
      this.searchPar=''
    },
    onSubmit() {
      console.log('submit!');
      this.$emit('sub')
    },
  }
}
</script>

<style scoped lang="less">
.myInput{
  /*opacity: 0.9;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  width: 574px;
  height: 75px;*/
  //box-shadow: 3px 0 7px 0 #747474;
}
/deep/ .el-input__inner {
  opacity: 1;
  border-radius: 12px 0 0 12px;
  width: 300px;
  height: 50px;
  border: none;
  font-size: 16px;
}
</style>
